#include "my_head.h"

bool UserDelete(p_user_node head)
{
    char name[20];
    if(head==NULL)
    {
        printf("error\n");
        return false;
    }
    p_user_node p=head->next;
    p_user_node x=head;
    printf("请输入你想要进行删除的用户信息的用户名:");
    scanf("%s",name);
    while(p!=NULL&&strcmp(name,p->data.user_name)!=0)
    {
        p=p->next;
        x=x->next;
    }
    if(p!=NULL)
    {
        x->next=p->next;
        free(p);
        printf("删除成功！\n");
        printf("=============\n");
        return true;
    }else
    {
        printf("未找到该用户信息！\n");
        printf("=============\n");
        return false;
    }
   

}